package com.ssm.blog.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ssm.blog.dao.PhotoDAO;
import com.ssm.blog.service.PhotoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PhotoServiceImpl implements PhotoService {
    @Autowired
    private PhotoDAO blogPhotoDAO;

    @Override
    public PageInfo<String> getBlogPhotoList(Integer pageNum) {
        PageHelper.startPage(pageNum, 30, "id desc");
        List<String> photoList = blogPhotoDAO.getBlogPhotoList();
        PageInfo<String> page = new PageInfo<>(photoList);
        return page;
    }
}
